<html>
<head>
<title>PLMosaic (Planet Labs Mosaics API)</title>
</head>

<body bgcolor="#ffffff">

<h1>PLMosaic (Planet Labs Mosaics API)</h1>

(GDAL/OGR &gt;= 2.0)<p>

This driver can connect to Planet Labs Mosaics API.
GDAL/OGR must be built with Curl support in order for the
PLMosaic driver to be compiled.<p>

The driver supports listing mosaics and reading them.
Mosaics are accessed at their highest resolution (Google Maps
level 15, i.e. 4.77 meters/pixel). Mosaics are typically composed of quads of
4096x4096 pixels.<p>

For mosaics of type Byte, overviews are available by using the tile API. For other
data types, there is no support for overviews, so requests that involve downsampling may
take a long time to complete.<p>

<h2>Dataset name syntax</h2>

The minimal syntax to open a datasource is : <pre>PLMosaic:[options]</pre><p>

Additional optional parameters can be specified after the ':' sign.
Currently the following one is supported :<p>

<ul>
<li> <b>api_key</b>=value: To specify the Planet API key. It is mandatory, unless
it is supplied through the open option API_KEY, or the configuration option PL_API_KEY.</li>
<li> <b>mosaic</b>=mosaic_name: To specify the mosaic name.</li>
<li><b>cache_path</b>=path: To specify the path to a directory where cached
quads (and tiles) are stored. A plmosaic_cache/{mosaic_name} subdirectory will be created
under that path. The empty string can be used to disable any disk caching.</li>
<li><b>trust_cache</b>=YES/NO: Whether already cached quads should be reused directly,
without prior checking if the server has a more recent version. Note:
this only applies to quads, and not tiles. Default is NO.</li>
<li><b>use_tiles</b>=YES/NO: Whether to use the tile API to access full
resolution data, instead of downloading quads. Only apply for Byte mosaics. Default is NO.</li>
</ul>

If several parameters are specified, they must be separated by a comma.<p>

<p>If no mosaic parameter is supplied, the list of available mosaics will be
returned as subdatasets. If only one mosaic is available, it will be directly
opened.</p>

<h2>Open options</h2>

<p>The following open options are available : API_KEY, MOSAIC, CACHE_PATH,
TRUST_CACHE and USE_TILES. They have the same semantics as the above
describe parameters of same name.</p>

<h2>Configuration options</h2>

The following configuration options are available :
<ul>
<li><b>PL_API_KEY</b>=value: To specify the Planet API key.</li>
</ul>

<h2>Location information</h2>

<p>
The special <i>Pixel_{x}_{y}</i> metadata item of the <i>LocationInfo</i> metadata domain,
where x is the column and y is the line in the mosaic, can be queried to get
information about the underneath quad and the scenes that compose it (only scenes
whose footprint intersect the point are listed). This is
the syntax used by the gdallocationinfo utility
(see <a href="https://trac.osgeo.org/gdal/wiki/rfc32_gdallocationinfo">RFC 32</a>)
</p>

<p>Below an example of the return :
<pre>
&lt;LocationInfo&gt;
    &lt;Quad&gt;
        &lt;id&gt;L15-0455E-1272N&lt;/id&gt;
        &lt;file_size&gt;9205776&lt;/file_size&gt;
        &lt;links_full&gt;https://api.planet.com/v0/mosaics/color_balance_mosaic/quads/L15-0455E-1272N/full&lt;/links_full&gt;
        &lt;links_mosaic&gt;https://api.planet.com/v0/mosaics/color_balance_mosaic&lt;/links_mosaic&gt;
        &lt;links_scenes&gt;https://api.planet.com/v0/mosaics/color_balance_mosaic/quads/L15-0455E-1272N/scenes/&lt;/links_scenes&gt;
        &lt;links_self&gt;https://api.planet.com/v0/mosaics/color_balance_mosaic/quads/L15-0455E-1272N&lt;/links_self&gt;
        &lt;links_thumbnail&gt;https://api.planet.com/v0/mosaics/color_balance_mosaic/quads/L15-0455E-1272N/thumb&lt;/links_thumbnail&gt;
        &lt;num_input_scenes&gt;5&lt;/num_input_scenes&gt;
        &lt;percent_covered&gt;23.52&lt;/percent_covered&gt;
        &lt;geometry&gt;POLYGON ((-100.019531236 40.04443758,-100.019531236 39.909736229899998,-99.843749986099994 39.909736229899998,-99.843749986099994 40.04443758,-100.019531236 40.04443758))&lt;/geometry&gt;
    &lt;/Quad&gt;
    &lt;Scenes&gt;
        &lt;Scene&gt;
            &lt;id&gt;20141014_165043_0908&lt;/id&gt;
            &lt;acquired&gt;2014/10/14 16:50:43+00&lt;/acquired&gt;
            &lt;camera_bit_depth&gt;8&lt;/camera_bit_depth&gt;
            &lt;camera_color_mode&gt;RGB&lt;/camera_color_mode&gt;
            &lt;camera_exposure_time&gt;1170&lt;/camera_exposure_time&gt;
            &lt;camera_gain&gt;560&lt;/camera_gain&gt;
            &lt;camera_tdi_pulses&gt;4&lt;/camera_tdi_pulses&gt;
            &lt;cloud_cover_estimated&gt;0&lt;/cloud_cover_estimated&gt;
            &lt;data_products_analytic_full&gt;https://api.planet.com/v0/scenes/ortho/20141014_165043_0908/full?product=analytic&lt;/data_products_analytic_full&gt;
            &lt;data_products_visual_full&gt;https://api.planet.com/v0/scenes/ortho/20141014_165043_0908/full?product=visual&lt;/data_products_visual_full&gt;
            &lt;file_size&gt;52363596&lt;/file_size&gt;
            &lt;image_statistics_gsd&gt;4.22939278619&lt;/image_statistics_gsd&gt;
            &lt;image_statistics_image_quality&gt;standard&lt;/image_statistics_image_quality&gt;
            &lt;image_statistics_snr&gt;38.816414101138&lt;/image_statistics_snr&gt;
            &lt;links_full&gt;https://api.planet.com/v0/scenes/ortho/20141014_165043_0908/full&lt;/links_full&gt;
            &lt;links_self&gt;https://api.planet.com/v0/scenes/ortho/20141014_165043_0908&lt;/links_self&gt;
            &lt;links_square_thumbnail&gt;https://api.planet.com/v0/scenes/ortho/20141014_165043_0908/square-thumb&lt;/links_square_thumbnail&gt;
            &lt;links_thumbnail&gt;https://api.planet.com/v0/scenes/ortho/20141014_165043_0908/thumb&lt;/links_thumbnail&gt;
            &lt;quad_metadata_percentage_of_quad&gt;1.72&lt;/quad_metadata_percentage_of_quad&gt;
            &lt;sat_alt&gt;625.335328005&lt;/sat_alt&gt;
            &lt;sat_id&gt;0908&lt;/sat_id&gt;
            &lt;sat_lat&gt;39.929866991&lt;/sat_lat&gt;
            &lt;sat_lng&gt;-99.7924758414&lt;/sat_lng&gt;
            &lt;sat_off_nadir&gt;2.16630567839854&lt;/sat_off_nadir&gt;
            &lt;strip_id&gt;1413305228.34946&lt;/strip_id&gt;
            &lt;sun_altitude&gt;37.0861376836067&lt;/sun_altitude&gt;
            &lt;sun_azimuth&gt;150.226745964007&lt;/sun_azimuth&gt;
            &lt;sun_local_time_of_day&gt;10.1924460550178&lt;/sun_local_time_of_day&gt;
            &lt;geometry&gt;POLYGON ((-99.972717127088671 39.955932287655287,-100.001449726838672 40.054504403484273,-100.15302892466832 40.028245144277392,-100.124005707005423 39.929632727481838,-99.972717127088671 39.955932287655287))&lt;/geometry&gt;
        &lt;/Scene&gt;
        &lt;Scene&gt;
            ...
        &lt;/Scene&gt;
    &lt;/Scenes&gt;
&lt;/LocationInfo&gt;
</pre>
</p>

<h3>Examples</h3>

<li> Listing all mosaics available (with the rights of the account) :
<pre>
gdalinfo "PLMosaic:" -oo API_KEY=some_value
</pre>
or
<pre>
gdalinfo "PLMosaic:api_key=some_value"
</pre>
or
<pre>
gdalinfo "PLMosaic:" --config PL_API_KEY some_value
</pre>

returns (in case of multiple mosaics):

<pre>
Driver: PLMOSAIC/Planet Labs Mosaics API
Files: none associated
Size is 512, 512
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=PIXEL
Subdatasets:
  SUBDATASET_1_NAME=PLMOSAIC:mosaic=color_balance_mosaic
  SUBDATASET_1_DESC=Color-Balanced Mosaic
  ...
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)
</pre>


<li> Open a particular mosaic :
<pre>
gdalinfo "PLMosaic:mosaic=color_balance_mosaic" -oo API_KEY=some_value
</pre>

returns:
<pre>
Driver: PLMOSAIC/Planet Labs Mosaics API
Files: none associated
Size is 8388608, 8388608
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],
    AUTHORITY["EPSG","3857"]]
Origin = (-20037508.339999999850988,20037508.339999999850988)
Pixel Size = (4.777314267160000,-4.777314267160000)
Metadata:
  FIRST_ACQUIRED=2014-03-20T15:57:11+00:00
  LAST_ACQUIRED=2015-04-06T11:38:16.570663+00:00
  TITLE=Color-Balanced Mosaic
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-20037508.340,20037508.340) (180d 0' 0.00"W, 85d 3' 4.06"N)
Lower Left  (-20037508.340,-20037508.340) (180d 0' 0.00"W, 85d 3' 4.06"S)
Upper Right (20037508.340,20037508.340) (180d 0' 0.00"E, 85d 3' 4.06"N)
Lower Right (20037508.340,-20037508.340) (180d 0' 0.00"E, 85d 3' 4.06"S)
Center      (   0.0000063,  -0.0000063) (  0d 0' 0.00"E,  0d 0' 0.00"S)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Overviews: 4194304x4194304, ..., 256x256
  Mask Flags: PER_DATASET ALPHA
  Overviews of mask band: Overviews: 4194304x4194304, ..., 256x256
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Overviews: 4194304x4194304, ..., 256x256
  Mask Flags: PER_DATASET ALPHA
  Overviews of mask band: Overviews: 4194304x4194304, ..., 256x256
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Overviews: 4194304x4194304, ..., 256x256
  Mask Flags: PER_DATASET ALPHA
  Overviews of mask band: Overviews: 4194304x4194304, ..., 256x256
Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha
  Overviews: 4194304x4194304, ..., 256x256
</pre>


<h2>See Also</h2>

<ul>
<li> <a href="https://www.planet.com/docs/v0/mosaics/">Documentation of Planet Mosaics API</a><p>
<li> <a href="https://www.planet.com/docs/v0/general-concepts/#authentication">API Authentication</a><p>
<li> <a href="drv_plscenes.html">Vector PLScenes / Planet Scenes API driver</a><p>
</ul>

</body>
</html>
